#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[10000];
	int b[10000];
	for(int i = 0; i<n; i++)
	{
		cin >> a[i] >> b[i];
	}
	sort(a, a+n);
	sort(b, b+n);
	
	int amin = a[n/2];
	int bmin = b[n/2];
	
	int sum = 0;
	for(int i = 0; i < n; i++)
	{
		sum+=abs(a[i] - amin) + abs(b[i] - bmin);
	}
	cout << sum <<endl;
	
	
	return 0;
}
